CLS
RANDOMIZE TIMER
INPUT "vvedite m"; m
DIM a(m)
INPUT "vvedite nachala diapazona"; a
INPUT "vvedite konec diapazona"; b
IF a > b THEN SWAP a, b
FOR i = 1 TO m
a(i) = INT(RND * ABS(b - a + 1) + a)
NEXT
FOR i = 1 TO m
PRINT a(i);
NEXT
PRINT STRING$(80, 196)
FOR i = 1 TO m
IF (a(i) AND 1) = 1 THEN s = s + a(i)
NEXT
FOR i = 1 TO m
IF (i AND 1) = 0 THEN a(i) = s
NEXT
FOR i = 1 TO m
PRINT a(i);
NEXT
Тестирование выполнено в программе QB64 ( Скачать )